<%--
  Created by IntelliJ IDEA.
  User: zzl
  Date: 2020/11/30
  Time: 11:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<html>
<head>
    <title>z员工列表</title>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <script type="text/javascript">
        function goBack()
        {
            window.history.back()
        }
    </script>
</head>
<body>
<div class="container">
    <!-- 搜索/批量删除 -->
    <div class="row">
        <div class="col-md-12">
            <h1 align="center" >数据查看</h1>
            <button onclick="goBack()" class="btn btn-info">返回上一操作</button>
            <a href="<%=basePath%>/service/list?pn=1" target="rightFrame" class="btn btn-info">数据首页</a>
        </div>
    </div>

    <div>
        <ul>
            <li>
                <form action="<%=basePath%>service/findByDay2" method="post">
                    <input type="text" name="searchByDay" placeholder="根据日期查询例如'08-20'">
                    <button>搜索</button>
                </form>
            </li>
        </ul>
    </div>


    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover table-striped ">
                <tr>
                    <th>真名</th>
                    <th>时间</th>
                    <th>日期</th>
                    <th>类型</th>
                    <th>种类</th>
                    <th>地点</th>
                    <th>地区</th>
                </tr>
                <c:forEach items="${daylist.list}" var="daylist">
                    <tr>
                        <th>${daylist.realname}</th>
                        <th>${daylist.s_time}</th>
                        <th><fmt:formatDate value="${daylist.s_day}" pattern="yyyy-MM-dd"  /> </th>
                        <th>${daylist.s_type}</th>
                        <th>${daylist.s_class}</th>
                        <th>${daylist.s_place}</th>
                        <th>${daylist.s_address}</th>
                    </tr>
                </c:forEach>

            </table>
            <div class="box">
                <div id="pagination" class="page center">
                </div>
            </div>

        </div>
        <div class="row">
            <%--           分页文字信息--%>
            <div class="col-md-6">
                当前${daylist.pageNum}页,总共${daylist.pages}页,共${daylist.total}条记录
            </div>

            <div class="col-md-6">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li><a href="<%=basePath%>service/findByDay?typepn=1">首页</a></li>

                        <c:if test="${daylist.hasPreviousPage}">
                            <li>
                                <a href="<%=basePath%>service/findByDay?typepn=${daylist.pageNum-1}" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                        </c:if>

                        <c:forEach items="${daylist.navigatepageNums}" var="page_Num">
                            <c:if test="${page_Num == daylist.pageNum}">
                                <li class="active"><a href="#">${page_Num }</a></li>
                            </c:if>
                            <c:if test="${page_Num != daylist.pageNum}">
                                <li><a href="<%=basePath%>service/findByDay?typepn=${page_Num }">${page_Num }</a></li>
                            </c:if>
                        </c:forEach>
                        <c:if test="${daylist.hasNextPage}">
                            <li> <a href="<%=basePath%>service/findByDay?typepn=${daylist.pageNum+1 }" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a></li>
                        </c:if>
                        <li><a href="<%=basePath%>service/findByDay?typepn=${daylist.pages}">末页</a></li>
                    </ul>
                </nav>
            </div>

        </div>
    </div>
</div>

  </body>

</html>
